//
//  WJQAlertCell.m
//  TourPlay
//
//  Created by dllo on 15/11/22.
//  Copyright © 2015年 王军岐. All rights reserved.
//

#import "WJQAlertCell.h"


@interface WJQAlertCell ()

@property (nonatomic, retain) UIImageView *checkImageV;

@end


@implementation WJQAlertCell


- (void)dealloc
{
    [_cellLabel release];
    [_checkImageV release];
    
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}
- (void)createSubViews
{
    
    
    self.cellLabel = [[UILabel alloc] initWithFrame:CGRectMake(10 * AUTOSCREEN_HEIGHT, 0, 50 * AUTOSCREEN_WIDTH, 60.f * AUTOSCREEN_HEIGHT)];
    self.cellLabel.backgroundColor = [UIColor clearColor];
    self.cellLabel.font = [UIFont systemFontOfSize:18.f * AUTOSCREEN_HEIGHT];
//    self.cellLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.cellLabel];
    [_cellLabel release];
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 60.f * AUTOSCREEN_HEIGHT - 2, self.frame.size.width, 2)];
    [self.contentView addSubview:view];
    [view release];
    
    [self addColorChangedBlock:^{
        
        view.nightBackgroundColor = [ColorSingleton shareSingleton].cellLineColor;
        view.normalBackgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1];
    }];
    
    // // map_check@2x.png
    
    self.checkImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"map_check@2x.png"]];
    self.checkImageV.frame = CGRectMake(190 * AUTOSCREEN_WIDTH, (60 - 10) * AUTOSCREEN_HEIGHT / 2.f, 12 * AUTOSCREEN_WIDTH, 10 * AUTOSCREEN_HEIGHT);
//    checkImageV.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.checkImageV];
    [_checkImageV release];
    
    self.checkImageV.hidden = YES;
}
- (void)checkWithisHidden:(NSString *)isHidden
{
//    NSLog(@"---%@", isHidden);
//    NSLog(@"- (void)checkWithisHidden:(NSString *)isHidden");
    if ([isHidden isEqualToString:@"1"]) {
        self.checkImageV.hidden = YES;
        self.cellLabel.textColor = [UIColor colorWithRed:0.47 green:0.44 blue:0.44 alpha:1];
    } else {
        self.checkImageV.hidden = NO;
        self.cellLabel.textColor = [UIColor colorWithRed:0.94 green:0.46 blue:0 alpha:1];
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
